const bannerDao = require("../dao/operation/bannerDao")
const { processingData } = require("../utils/tool")

module.exports.findBanner = async function() {
    let arr = []
    const result = await bannerDao.bannerNews()
    if (result) {
        arr = processingData(result)
        return arr
    }
    return result
}


module.exports.updateBanner = async function(bannerArr) {
    let arr = []
    const result = await bannerDao.updateBanner(bannerArr)
    if (result) {
        arr = processingData(result)
        return arr
    }
    return result
}